An Implementation of Python for Racket
نویسندگان
چکیده
Racket is a descendent of Scheme that is widely used as a first language for teaching computer science. To this end, Racket provides DrRacket, a simple but pedagogic IDE. On the other hand, Python is becoming increasingly popular in a variety of areas, most notably among novice programmers. This paper presents an implementation of Python for Racket which allows programmers to use DrRacket with Python code, as well as adding Python support for other DrRacket based tools. Our implementation also allows Racket programs to take advantage of Python libraries, thus significantly enlarging the number of usable libraries in Racket. Our proposed solution involves compiling Python code into semantically equivalent Racket source code. For the runtime implementation, we present two different strategies: (1) using a foreign function interface to directly access the Python virtual machine, therefore borrowing its data types and primitives or (2) implementing all of Python’s data model purely over Racket data types. The first strategy provides immediate support for Python’s standard library and existing third-party libraries. The second strategy requires a Racket-based reimplementation of all of Python’s features, but provides native interoperability between Python and Racket code. Our experimental results show that the second strategy far outmatches the first in terms of speed. Furthermore, it is more portable since it has no dependencies on Python’s virtual machine.
منابع مشابه
PyonR: A Python Implementation for Racket
The Python programming language is becoming increasingly popular in a variety of areas, most notably among novice programmers, due to its readable syntax and extensive libraries. On the other hand, the Racket language and its DrRacket IDE have a tradition for being used to introduce Computer Science concepts to students. Besides, the Racket platform can be extended to support other programming ...
متن کاملImplementing Python for DrRacket
The Python programming language is becoming increasingly popular in a variety of areas, most notably among novice programmers. On the other hand, Racket and other Scheme dialects are considered excellent vehicles for introducing Computer Science concepts. This paper presents an implementation of Python for Racket and the DrRacket IDE. This allows Python programmers to use Racket libraries and v...
متن کاملAn Implementation of Python for DrRacket
The Python programming language is becoming increasingly popular in a variety of areas, most notably among novice programmers. This paper presents an implementation of Python for DrRacket which allows Python programmers to use DrRacket’s features with Python code, as well as adding Python support for DrRacket based tools, such as Rosetta. The suggested approach involves compiling Python code in...
متن کاملP2R: Implementation of Processing in Racket
Processing is a programming language and development environment created to teach programming in a visual context. In spite of its enormous success, Processing remains a niche language with limited applicability outside the visual realm. Moreover, architects that have learnt Processing are unable to use the language with traditional Computer-Aided Design (CAD) and Building Information Modelling...
متن کاملMeta-tracing makes a fast Racket
Tracing just-in-time (JIT) compilers record and optimize the instruction sequences they observe at runtime. With some modifications, a tracing JIT can perform well even when the executed program is itself an interpreter, an approach called meta-tracing. The advantage of meta-tracing is that it separates the concern of JIT compilation from language implementation, enabling the same JIT compiler ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2014